//
//  LoginRepository.swift
//  SwiftUI+MVVM+Repository
//
//  Created by 高强 on 2024/9/10.
//

import Moya

class LoginRepository {
    private let apiService: APIService
    
    init(apiService: APIService = APIService()) {
        self.apiService = apiService
    }
    
    // 登录请求
    func login(username:String,password:String,completion: @escaping (Bool, String?) -> Void){
        
        // 检查用户名和密码
        if username == "admin" && password == "123456" {
            completion(true,nil)
        }else{
            completion(false,"用户名或密码错误")
        }
        
        
        //return apiService.request(AuthAPI.login(username: username, password: password), type: AuthResponse.self)
        
        
    }
}

